package myrecyclerview

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.yannuo.myrecyclerview.databinding.ActivityMainBinding

/**
 * @dsc     简介
 * @Author  LiWeiZhong
 * @Date    2025/6/5 17:21
 * @Version 1.0
 */
class MainActivity : AppCompatActivity(){

    private lateinit var binding: ActivityMain2Binding
    private val adapter by lazy { ItemAdapter() }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.rv.layoutManager = MyLinearLayoutManager(this)
        binding.rv.adapter = adapter
        adapter.data = arrayListOf<String>().apply {
            for (i in 1..200) {
                add(i.toString())
            }
        }
    }
}